/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bkt.service.model.hr.leave.impl;

import bkt.model.hr.leave.PaternityLeave;
import bkt.repository.jpa.GenericDAO;
import bkt.service.model.hr.leave.PaternityLeaveService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author hashcode
 */
@Service("paternityLeaveService")
public class PaternityLeaveServiceImpl implements PaternityLeaveService {

    @Autowired
    private GenericDAO< PaternityLeave> dao;
    public final void setDao(final GenericDAO< PaternityLeave> daoToSet) {
        this.dao = daoToSet;
        this.dao.setClazz(PaternityLeave.class);
    }
    public PaternityLeaveServiceImpl() {
    }

    @Override
    public PaternityLeave findById(String id) {
        setDao(dao);
        return dao.findById(id);
    }

    @Override
    public List<PaternityLeave> findAll() {
        setDao(dao);
        return dao.findAll();
    }

    @Override
    public void persist(PaternityLeave entity) {
        setDao(dao);
        dao.persist(entity);
    }

    @Override
    public void merge(PaternityLeave entity) {
        setDao(dao);
        dao.merge(entity);
    }

    @Override
    public void remove(PaternityLeave entity) {
        setDao(dao);
        dao.remove(entity);
    }

    @Override
    public void removeById(String entityId) {
        setDao(dao);
        PaternityLeave v = dao.findById(entityId);
        dao.remove(v);
    }

    @Override
    public List<PaternityLeave> findInRange(int firstResult, int maxResults) {
        setDao(dao);
        return dao.findInRange(firstResult, maxResults);
    }

    @Override
    public long count() {
        setDao(dao);
        return dao.count();
    }

    @Override
    public PaternityLeave getByPropertyName(String name, String value) {
        setDao(dao);
        return dao.getByPropertyName(name, value);
    }

    @Override
    public List<PaternityLeave> getEntitiesByProperName(String name, String value) {
        setDao(dao);
        return dao.getEntitiesByProperName(name, value);
    }

   
}